package com.ailink.collection.map;

import java.util.HashMap;

/**
 * Created by Administrator on 2018/3/5
 */
public class HashMapTest {

    public static void main(String[] args) {
//        new HashMap<String, String>(16, Float.NaN);
        HashMap<Integer, Integer> hashMap1 = new HashMap<>(2);
        int size1 = hashMap1.size();
        HashMap<String, Object> hashMap2 = new HashMap<>(100);
        int size2 = hashMap2.size();
        System.out.println(size1);
        System.out.println(size2);
//        hashMap1.put(new Integer(1), new Integer(1));
//        hashMap1.put(new Integer(1), new Integer(1));

//        HashMap<String, Object> hashMap = new HashMap<>(100);
//        hashMap.put("name", "idea");
//        hashMap.putIfAbsent("name", "abc");
//        Map map = Collections.synchronizedMap(hashMap);
//        Hashtable<String, Object> hashtable = new Hashtable<>();
//        hashtable.put("name", "idea");
//        ConcurrentHashMap<String, Object> concurrentHashMap = new ConcurrentHashMap<>();
//        concurrentHashMap.put("name", "idea");
//        CopyOnWriteArrayList<String> copyOnWriteArrayList = new CopyOnWriteArrayList<>();
//        copyOnWriteArrayList.add("idea");
//        CopyOnWriteArraySet<String> copyOnWriteArraySet = new CopyOnWriteArraySet<>();
//        copyOnWriteArraySet.add("idea");
//        copyOnWriteArraySet.add("idea");
    }


}
